package com.firebird.oms.domain.sm;

// Generated 2009-11-26 19:55:31 by Hibernate Tools 3.2.5.Beta

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;

/**
 * TismArea generated by hbm2java
 */
@Entity
@Table(name = "tism_area")
public class TismArea implements java.io.Serializable {

	private static final long serialVersionUID = 439935883611993833L;
	private Integer areaId;
	private String areaName;
	private String areaDesc;
	private Integer companyId;
	private String companyName;
	private Integer state;
	private String note;
	private Integer staffId;
	private Date createTime;
	private Date modifyTime;

	public TismArea() {
	}

	public TismArea(Integer companyId, Integer staffId, Date createTime,
			Date modifyTime) {
		this.companyId = companyId;
		this.staffId = staffId;
		this.createTime = createTime;
		this.modifyTime = modifyTime;
	}

	public TismArea(String areaName, String areaDesc, Integer companyId,
			Integer state, String note, Integer staffId, Date createTime,
			Date modifyTime) {
		this.areaName = areaName;
		this.areaDesc = areaDesc;
		this.companyId = companyId;
		this.state = state;
		this.note = note;
		this.staffId = staffId;
		this.createTime = createTime;
		this.modifyTime = modifyTime;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "area_id", unique = true, nullable = false)
	public Integer getAreaId() {
		return this.areaId;
	}

	public void setAreaId(Integer areaId) {
		this.areaId = areaId;
	}

	@Column(name = "area_name", length = 60)
	public String getAreaName() {
		return this.areaName;
	}

	public void setAreaName(String areaName) {
		this.areaName = areaName;
	}

	@Column(name = "area_desc")
	public String getAreaDesc() {
		return this.areaDesc;
	}

	public void setAreaDesc(String areaDesc) {
		this.areaDesc = areaDesc;
	}

	@Column(name = "company_id", nullable = false)
	public Integer getCompanyId() {
		return this.companyId;
	}

	public void setCompanyId(Integer companyId) {
		this.companyId = companyId;
	}
	
	@Transient
	public String getCompanyName() {
		return companyName;
	}

	public void setCompanyName(String companyName) {
		this.companyName = companyName;
	}

	@Column(name = "state")
	public Integer getState() {
		return this.state;
	}

	public void setState(Integer state) {
		this.state = state;
	}

	@Column(name = "note", length = 65535)
	public String getNote() {
		return this.note;
	}

	public void setNote(String note) {
		this.note = note;
	}

	@Column(name = "staff_id", nullable = false)
	public Integer getStaffId() {
		return this.staffId;
	}

	public void setStaffId(Integer staffId) {
		this.staffId = staffId;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "create_time", nullable = false, length = 0)
	public Date getCreateTime() {
		return this.createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "modify_time", nullable = false, length = 0)
	public Date getModifyTime() {
		return this.modifyTime;
	}

	public void setModifyTime(Date modifyTime) {
		this.modifyTime = modifyTime;
	}

	public boolean equals(final Object other) {
		if (!(other instanceof TismArea))
			return false;
		TismArea castOther = (TismArea) other;
		return new EqualsBuilder().append(areaId, castOther.areaId).append(
				areaName, castOther.areaName).append(areaDesc,
				castOther.areaDesc).append(companyId, castOther.companyId)
				.append(state, castOther.state).append(note, castOther.note)
				.append(staffId, castOther.staffId).append(createTime,
						castOther.createTime).append(modifyTime,
						castOther.modifyTime).isEquals();
	}

	public int hashCode() {
		return new HashCodeBuilder().append(areaId).append(areaName).append(
				areaDesc).append(companyId).append(state).append(note).append(
						staffId).append(createTime).append(modifyTime).toHashCode();
	}

	public String toString() {
		return new ToStringBuilder(this).append("areaId", areaId).append(
				"areaName", areaName).append("areaDesc", areaDesc).append(
				"companyId", companyId).append("state", state).append("note",
				note).append("loginId", staffId).append("createTime",
				createTime).append("modifyTime", modifyTime).toString();
	}

}
